/* 
 *  javascribd - Java client library for the Scribd API. 
 *  Copyright (C) 2009 by Marcel Eyke, http://code.google.com/p/javascribd/ 
 *  Use is subject to license terms of LGPL. See license.txt. 
 */
package com.google.code.javascribd.type;

public class ApiKey {
	private final String apiKey;

	public ApiKey(String apiKey) {
		if (apiKey == null) {
			throw new IllegalArgumentException("apiKey must be not null");
		}
		this.apiKey = apiKey;
	}

	@Override
	public int hashCode() {
		assert apiKey != null;
		return apiKey.hashCode();
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ApiKey other = (ApiKey) obj;
		assert apiKey != null;
		assert other.apiKey != null;
		return apiKey.equals(other.apiKey);
	}

	@Override
	public String toString() {
		assert apiKey != null;
		return apiKey.toString();
	}
}
